package edu.washington.cs.workflow.analysis.guistructure.uievents;

import org.uispec4j.Panel;
import org.uispec4j.UIComponent;

import edu.washington.cs.workflow.analysis.guistructure.UIPos;

public interface UIEvent {

	enum UIAction{Click, RightClick, DoubleClick, SetText,
		Select, Unselect, Nextvalue, Prevalue /*for spinner*/,
		SetPost /*for slide*/}
	
	enum WINDOW {NONE, MODAL, NONMODAL} /**The consequence */
	
	public UIComponent getUIComponent();
	
	/**The component position on the panel */
	public UIPos getUIComponentPos();
	
	public void setUIComponentPos(UIPos pos);
	
	public UIAction getAction();
	
	public String getDescription();
	
	public void setAboveEvent(UIEvent e);
	
	/**The effect of poping up a new window.
	 * would it have some side effect? (ignore it!) */
	public boolean canFireEvent();
	
	public UIEventOutcome fireEvent();
	
	public Panel getCurrentPanel();
	
	public boolean isCurrentPanelClosed();
	
	/**
	 * If this event has been executed, we keep track of whether the execution
	 * will pop up a new window or not. It returns null if the event has not executed.
	 * */
	public WINDOW probeWindowInfo();
	
	/**
	 * It decides how to execute the UI event
	 * */
	public void setWindowFlag(WINDOW winFlag);
	
	public WINDOW getWindowFlag();
}